home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
call.zip
/
CALL.C
next >
Wrap
Text File
|
1988-09-09
|
1KB
|
48 lines
/*
* call.c allows return from batch files invoked by a batch file
* simulates DOS 3.3 'call' command
*
* 06/06/88 George Palecek tc
* CIS: 70206,332
* UUCP: gpalecek@duorion.edu
*
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAXPATHLEN 128
/*----MAIN PROGRAM BEGINS HERE----------------------------------------------*/
/*
* Check for number of command line args if any. If no args, error message.
*/
main ( argc, argv )
int argc;
char **argv;
{
char command [MAXPATHLEN];
int i, ret_code;
command [0] = '\0';
if ( argc < 2 ) /* check for file name in command line arg */
{
fprintf ( stderr, "\nUsage: call {batch file} [parameters] ...\n\n" );
ret_code = 1;
}
else
{
for ( i = 0; i < argc; ++i )
{
*argv++;
strcat ( command, *argv );
strcat ( command, " " );
}
ret_code = system ( command );
}
return ( ret_code );
}